package com.cy.pj.notice.jdbc;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.sql.SQLException;

public class NoticeJdbcTest {

    @Autowired
    NoticeJdbc nj;

    @Test
    void insertNotice() throws SQLException {
        String sql = " insert into sys_notices"+
                " (id,title,type,content,status,createdUser,createdTime,modifiedUser,modifiedTime,remark)" +
                " values(?,?,?,?,?,?,?,?,?,?)";
        Object[] notice = {"112","调课通知","1","教务处","0","马老师","2021-06-18 10:00:00 ","大数据18班","2021-6-20 12:00:00","全体同学"};
        nj.insertNotice(sql, notice);
        System.out.println("插入成功");
    }
    @Test
    void selectNotice() throws SQLException {
        String sql = "select id,title,content,status,type,createdTime from sys_notices where id>=?";
        nj.selectNotices(sql);
        System.out.println("查找成功");
    }

}
